import { Effect } from 'umi';
import { message } from 'antd';
import {saveMachine} from "@/services/machine"

export interface MachineModelType {
  namespace: string;
  state: {};
  effects: {
    saveMachine: Effect;
  };
}

const MachineModel: MachineModelType = {
  namespace: 'machine',

  state: {},

  effects: {
    *saveMachine({ payload }, { call }) {
      yield call(saveMachine, payload);
      message.success('提交成功');
    },
  },
};

export default MachineModel;
